home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / PROGRAMS / CH5 / 5-3-7.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-09-18  |  2.3 KB  |  78 lines

  1. VERSION 5.00
  2. Begin VB.Form frm5_3_7 
  3.    Caption         =   "Seasons"
  4.    ClientHeight    =   1980
  5.    ClientLeft      =   2490
  6.    ClientTop       =   1725
  7.    ClientWidth     =   2310
  8.    BeginProperty Font 
  9.       Name            =   "MS Sans Serif"
  10.       Size            =   8.25
  11.       Charset         =   0
  12.       Weight          =   700
  13.       Underline       =   0   'False
  14.       Italic          =   0   'False
  15.       Strikethrough   =   0   'False
  16.    EndProperty
  17.    LinkTopic       =   "Form1"
  18.    PaletteMode     =   1  'UseZOrder
  19.    ScaleHeight     =   1980
  20.    ScaleWidth      =   2310
  21.    Begin VB.PictureBox picNumDays 
  22.       Height          =   375
  23.       Left            =   120
  24.       ScaleHeight     =   315
  25.       ScaleWidth      =   1995
  26.       TabIndex        =   3
  27.       Top             =   1440
  28.       Width           =   2055
  29.    End
  30.    Begin VB.CommandButton cmdNumDays 
  31.       Caption         =   "Number of Days"
  32.       Default         =   -1  'True
  33.       Height          =   495
  34.       Left            =   120
  35.       TabIndex        =   2
  36.       Top             =   720
  37.       Width           =   2055
  38.    End
  39.    Begin VB.TextBox txtSeason 
  40.       Height          =   285
  41.       Left            =   840
  42.       TabIndex        =   1
  43.       Top             =   240
  44.       Width           =   1335
  45.    End
  46.    Begin VB.Label lblSeason 
  47.       Alignment       =   1  'Right Justify
  48.       Caption         =   "Season"
  49.       Height          =   255
  50.       Left            =   0
  51.       TabIndex        =   0
  52.       Top             =   240
  53.       Width           =   735
  54.    End
  55. Attribute VB_Name = "frm5_3_7"
  56. Attribute VB_GlobalNameSpace = False
  57. Attribute VB_Creatable = False
  58. Attribute VB_PredeclaredId = True
  59. Attribute VB_Exposed = False
  60. Private Sub cmdNumDays_Click()
  61.   Dim season As String
  62.   'Determine the number of days in a season
  63.   picNumDays.Cls
  64.   season = txtSeason.Text
  65.   picNumDays.Print season; " has"; NumDays(season); "days."
  66. End Sub
  67. Private Function NumDays(season As String) As Integer
  68.   'Look up the number of days in a given season
  69.   Select Case UCase(season)
  70.     Case "WINTER"
  71.       NumDays = 87
  72.     Case "SPRING"
  73.       NumDays = 92
  74.     Case "SUMMER", "AUTUMN", "FALL"
  75.       NumDays = 93
  76.   End Select
  77. End Function
  78.